﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _04抽象工厂
{
    public interface IFacatory
    {
        IDatabaseUser GetDatabaseUser();
        IDatabaseDepartment GetDatabaseDepartment();
    }
    public class SqlliteFacatory : IFacatory
    {
        public IDatabaseDepartment GetDatabaseDepartment()
        {
            return  new SqlliteDepartment();
        }

        public IDatabaseUser GetDatabaseUser()
        {
            return new SqlliteUser();
        }
    }
    public class MysqlFacatory : IFacatory
    {
        public IDatabaseDepartment GetDatabaseDepartment()
        {
            return new MysqlDepartment();
        }
        public IDatabaseUser GetDatabaseUser()
        {
            return new MysqlUser();
        }
    }
    public class SqlserverFacatory : IFacatory
    {
        public IDatabaseDepartment GetDatabaseDepartment()
        {
            return new SqlServerDepartment();
        }
        public IDatabaseUser GetDatabaseUser()
        {
            return new SqlServerUser();
        }
    }
}
